home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Games Extra 1996 June
/
Amiga Games Extra 1996 #6.iso
/
userbox
/
publicdomain
/
iffmaster
/
rexx
/
loadiffmaster.dopus
< prev
next >
Wrap
Text File
|
1996-03-23
|
2KB
|
99 lines
/*
** $VER: IFFMaster.dopus 0.001 (12 Feb 1996) **
**
** © 1996 Andreas Mixich
**
** PROGRAMNAME:
** IFFMaster.dopus
**
** FUNCTION:
** Loads selected IFF file into IFFMaster 1.5
** You can still do this without this script, but not if there is already
** an IFFMaster running.
**
** $HISTORY:
**
** 12 Feb 1996 : 0.01 : initial release
*/
/* enable support functions */
OPTIONS RESULTS
SIGNAL ON ERROR
SIGNAL ON FAILURE
SIGNAL ON HALT
SIGNAL ON BREAK_C
SIGNAL ON SYNTAX
/* define some usefull vars */
LF = '0A'x /* linefeed */
scriptname = 'IFFMaster.dopus' /* insert scriptname. will be needed later */
iffport = 'IFFMASTER.1' /* Name of port for IFFMaster */
dopusport = 'DOPUS.1' /* name of Dopus port */
iffmastercommand = 'GFX:Tools/IFFMaster' /* set to where you keep IFFMaster */
/* address DOPUS */
ADDRESS Value dopusport
/* usefull actions. get the listers */
'STATUS 3' /* active window */
win = RESULT
'STATUS 13' win /* pathname of active window */
path = RESULT
'GETNEXTSELECTED' win /* getnextselected entry */
file = RESULT
ADDRESS Value iffport
IF ~SHOW('Ports',iffport) THEN
DO
ADDRESS COMMAND 'Run >NIL: '||iffmastercommand
ADDRESS COMMAND 'WaitForPort '||iffport
IF ~SHOW('Ports',iffport) THEN
EXIT 10
END
'LOAD '||path||file /* load file into IFFMaster */
ADDRESS DOPUS.1 /* get back to dopus */
SELECTFILE file 0 1 /* deselect file */
EXIT(0)
/* universal requester function */
DREQUEST:
PARSE VAR ErrText, RtValue
ADDRESS DOPUS.1
REQUEST scriptname||'0a'x||ErrText||'0a'x||RtValue
RETURN RtValue
/* what to do on BREAK_C or on HALT */
BREAK_C:
HALT:
Err1 = 'Script interrupted'
Err2 = 'Execution Ceased at line - 'SIGL
Err3 = 'Source Line: 'SourceLine(SIGL)
ErrText = Err1'*n'Err2'*n'Err3
CALL DRequest(ErrText,RtValue)
EXIT 10
RETURN
/* routine for an error */
ERROR:
SYNTAX:
FAILURE:
Err1 = 'Trapped Error: 'ErrorText(rc)
Err2 = 'Line 'SIGL':'SourceLine(SIGL)
ErrText = Err1'*n'Err2
CALL DRequest(ErrText,RtValue)
EXIT 20
RETURN